package im.eg.transaction;

import im.eg.springdemo2.stuffs2.AService;
import im.eg.transaction.stuffs.AppConfig;
import im.eg.transaction.stuffs.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        System.out.println("========================");
        UserService userService = (UserService) context.getBean("userService");

        //UserService中使用了@Transactional，容器中的userService实际是一个代理对象
        System.out.println(userService.getClass());//class im.eg.transaction.stuffs.UserService$$EnhancerBySpringCGLIB$$e962825c
        userService.one();

    }
}
